package com.wuchao.interfaces;

/**
 * 作者：吴超
 * 邮箱：wuchao_19931120@163.com
 * 时间：2021-10-10
 * 描述：
 */

public class Employee implements Comparable<Employee>{
    private final String name;
    private double salary;

    public Employee(String name, double salary){
        this.name = name;
        this.salary = salary;

    }

    public String getName(){
        return name;
    }

    public double getSalary(){
        return salary;
    }

    public void raiseSalary(double byPercent){
        double raise = salary * byPercent / 100;
        salary += raise;
    }


    @Override
    public int compareTo(Employee other) {
        return Double.compare(salary,other.salary);
    }
}
